package cn.ml.ssmdemo.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

public class Student {
    @Override
    public String toString() {
        return "Student{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", gender='" + gender + '\'' +
                ", bornday=" + bornday +
                '}';
    }

    public Student() {
    }

    public Student(Integer id, String name, String gender) {
        this.id = id;
        this.name = name;
        this.gender = gender;
    }

    /**
     *
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column xueyuan.id
     *
     * @mbg.generated Tue Aug 03 08:59:14 GMT+08:00 2021
     */
    private Integer id;

    /**
     *
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column xueyuan.name
     *
     * @mbg.generated Tue Aug 03 08:59:14 GMT+08:00 2021
     */
    private String name;

    /**
     *
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column xueyuan.gender
     *
     * @mbg.generated Tue Aug 03 08:59:14 GMT+08:00 2021
     */
    private String gender;

    /**
     *
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column xueyuan.bornday
     *
     * @mbg.generated Tue Aug 03 08:59:14 GMT+08:00 2021
     */
    //将Date类型转换为"yyyy-MM-dd HH:mm"保存在json返回给页面
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    //将前台提交的"yyyy-MM-dd HH:mm"字符串转换为Date类型
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date bornday;

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column xueyuan.id
     *
     * @return the value of xueyuan.id
     *
     * @mbg.generated Tue Aug 03 08:59:14 GMT+08:00 2021
     */
    public Integer getId() {
        return id;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column xueyuan.id
     *
     * @param id the value for xueyuan.id
     *
     * @mbg.generated Tue Aug 03 08:59:14 GMT+08:00 2021
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column xueyuan.name
     *
     * @return the value of xueyuan.name
     *
     * @mbg.generated Tue Aug 03 08:59:14 GMT+08:00 2021
     */
    public String getName() {
        return name;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column xueyuan.name
     *
     * @param name the value for xueyuan.name
     *
     * @mbg.generated Tue Aug 03 08:59:14 GMT+08:00 2021
     */
    public void setName(String name) {
        this.name = name == null ? null : name.trim();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column xueyuan.gender
     *
     * @return the value of xueyuan.gender
     *
     * @mbg.generated Tue Aug 03 08:59:14 GMT+08:00 2021
     */
    public String getGender() {
        return gender;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column xueyuan.gender
     *
     * @param gender the value for xueyuan.gender
     *
     * @mbg.generated Tue Aug 03 08:59:14 GMT+08:00 2021
     */
    public void setGender(String gender) {
        this.gender = gender == null ? null : gender.trim();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column xueyuan.bornday
     *
     * @return the value of xueyuan.bornday
     *
     * @mbg.generated Tue Aug 03 08:59:14 GMT+08:00 2021
     */
    public Date getBornday() {
        return bornday;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column xueyuan.bornday
     *
     * @param bornday the value for xueyuan.bornday
     *
     * @mbg.generated Tue Aug 03 08:59:14 GMT+08:00 2021
     */
    public void setBornday(Date bornday) {
        this.bornday = bornday;
    }
}